<?php
function autoload($class_name) {
    $this_dir = dirname(__FILE__) . '/';
    require($this_dir . '../conf/autoload.conf'); //不能用require_once
    if(isset($rules['equal'][$class_name])) {
        require_once($rules['equal'][$class_name]);
        return true;
    }

    foreach($rules['match'] as $k=>$v) {
        if(1 === preg_match('/' . $k . '/', $class_name)) {
            require_once($v . $class_name . '.php');
            return true;
        }
    }
}
spl_autoload_register('autoload');
?>
